﻿@{
    Layout = null;
    ViewData["Title"] = "IndexValid";
}

<script src="~/js/vue.js"></script>
<script src="~/js/axios.js"></script>
<script src="~/element-ui/lib/index.js"></script>
<link rel="stylesheet" href="~/element-ui/lib/theme-chalk/index.css" />

<h1>有效简历查询IndexValid</h1>
<div id="app">
    <el-table :data="tableData"
              stripe
              style="width: 100%">
        <el-table-column prop="human_name"
                         label="姓名">
        </el-table-column>
        <el-table-column prop="human_age"
                         label="年龄">
        </el-table-column>
        <el-table-column prop="human_major_kind_name"
                         label="应聘岗位">
        </el-table-column>
        <el-table-column prop="human_major_name"
                         label="职位">
        </el-table-column>
        <el-table-column prop="human_mobilephone"
                         label="手机号码">
        </el-table-column>
        <el-table-column prop="human_college"
                         label="毕业院校">
        </el-table-column>
        <el-table-column prop="engage_type"
                         label="招聘途径">
        </el-table-column>
        <el-table-column label="操作">
            <template slot-scope="scope">
                <el-button size="mini"
                           v-on:click="handleEdit(scope.row)">开始面试</el-button>
                <el-button size="mini"
                           type="danger"
                           v-on:click="handleDelete(scope.row.res_id)">删除</el-button>
            </template>
        </el-table-column>
    </el-table>
    <el-pagination v-on:size-change="handleSizeChange"
                   v-on:current-change="handleCurrentChange"
                   :current-page="pgcurrent"
                   :page-sizes="[3, 6, 9, 11]"
                   :page-size="pgsize"
                   layout="total, sizes, prev, pager, next, jumper"
                   :total="rows">
    </el-pagination>
</div>

<script type="text/javascript">
    var vue = new Vue({
        el : "#app",
        data: {
             //表格数据源集合
            tableData: [],
            pgsize: 3,
            pgcurrent: 1,
            rows: 0,

        },
        methods: {
            //有效简历刷新
            fill() {
                axios.get("/EngageResume/EngageResumeValidFill?pgsize=" + this.pgsize + "&pgcurrent=" + this.pgcurrent).then((res) => {
                    this.tableData = res.data.tabs;
                    this.rows = res.data.rows;
                })
            },
            //开始面试按钮事件
            handleEdit(val) {
                window.location.href="/EngageInterview/Index";
                console.info(val);
            },
            //删除按钮事件
            handleDelete(res_id) {
                console.info(res_id);
            },
            //页容量大小改变事件
            handleSizeChange(val) {
                this.pgsize = val;
            },
            //页下标页码改变事件
            handleCurrentChange(val) {
                this.pgcurrent = val;
            }
        },
        mounted: function() {
            this.fill();
        }

    })

</script>
